import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'layout',
      component: () => import('@/views/Layout/layoutPage.vue'),
      redirect: '/organization',
      children: [
        {
          path: '/organization',
          name: 'organization',
          component: () =>
            import('@/views/Organization/institutionalFramework.vue')
        },
        {
          path: '/facility',
          name: 'facility',
          component: () => import('@/views/Facility/deviceManagement.vue')
        },
        {
          path: '/role',
          name: 'role',
          component: () => import('@/views/Role/roleManagement.vue')
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/Login/loginPage.vue')
    }
  ]
})

export default router
